package cn.baidu.Servlet;

import cn.baidu.service.service;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/delete")   // 访问该类唯一路径
public class del extends HttpServlet {



    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setCharacterEncoding("UTF-8");//设置返回数据的编码方式
        resp.setHeader("Content-type", "text/html; charset=utf-8");//设置返回数据的格式为json
        req.setCharacterEncoding("UTF-8");//设置接收参数的编码方式
        String id = req.getParameter("id");
        service ser = new service();
        ser.delRoom(Integer.parseInt(id));
     req.getRequestDispatcher("/houtai").forward(req,resp);

    }


}
